<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>background-size的运用</title>
	<style type="text/css">
		div {
			width: 50px;
			height: 50px;
			border: 1px solid red;
			background: url(bg.jpg) no-repeat;
			background-size: contain;
		}
	</style>
</head>
<body>
	<div></div>
</body>
</html>